﻿@{
    ViewBag.Title = "factoryEdit";
}
<script>
    function check() {
            var did=document.getElementById("id");
            var dname=document.getElementById("name");
            if(did.value==""){
                alert("You must give the id");
                return;
            }
            if(dname.value==""){
                alert("You must give the name");
                return;
            }
            if(dname.value.search(/\d/i)!=-1){
                alert("Do not give number to name");
                dname.value="";
                return;
            }
            alert("OK");
            did.value="";
            dname.value="";
        
   
        }
</script>
<form id="form1">
    Id<input type="text" id="id" autocomplete="off"><br>
    Name<input type="text" id="name" autocomplete="off"><br>
    City<select name="citys">
        <option value="Miskolc">Miskolc</option>
        <option value="Budapest">Budapest</option>
    </select><br>



    <input type="button" value="Add new factory" onclick="check()" />
</form>